<?php
namespace App\Modules\Menu;
use App\Modules\AdapterApi;
use App\Services\User\UserIndex;
/**
 * Created by PhpStorm.
 * User: ws
 * Date: 20180612
 */
class MenuCate extends AdapterApi
{
    // 为某一个应用增加一个菜单分类
    public function add(): array
    {
        $data = pick_array($this->postData,['app_id','name','name_cn']);

        return UserIndex::MenuCate()->add($data);
    }
    // 禁用某一应用的某一菜单分类
    public function stop(): array
    {
        $data = pick_array($this->postData,['id','name']);

        return UserIndex::MenuCate()->stop($data);
    }
    // 获取某一应用所有的可用菜单分类列表(不分页)
    public function listByApp(): array
    {
        $data = pick_array($this->postData,['app_id']);

        return UserIndex::MenuCate()->listByApp($data);
    }
    // 列表
   public function list(): array
    {
        $data = pick_array($this->postData,['token','list_rows','page']);

        return UserIndex::MenuCate()->list($data);
    }
    // 启用某一应用的某一菜单分类
    public function start(): array
    {
        $data = pick_array($this->postData,['id','name']);

        return UserIndex::MenuCate()->start($data);

    }
    // 获取某一应用所有的菜单分类列表(不分页)
    public function listAllByApp(): array
    {
        $data = pick_array($this->postData,['app_id']);

        return UserIndex::MenuCate()->listAllByApp($data);
    }
    // 编辑一个菜单分类
    public function edit(): array
    {
        $data = pick_array($this->postData,['id', 'name', 'name_cn']);

        return UserIndex::MenuCate()->edit($data);
    }

   
}